package indi.fritz.bigmap.common;

public class DBException extends RuntimeException{
	private static final long serialVersionUID = -2771009550611753530L;

	public DBException(Throwable cause) {
        super(cause);
    }
	
	public DBException(String message) {
        super(message);
    }

    public DBException(String message, Throwable cause) {
        super(message,cause);
    }

    public DBException() {
        super();
    }
    
    public static class DBWriteException extends DBException{
		private static final long serialVersionUID = -2290573856986970315L;
		public DBWriteException(Throwable e){
            super("写入数据库错误", e);
        }
    }
    
    public static class DBDeleteException extends DBException{
		private static final long serialVersionUID = 3416999877633519892L;
		public DBDeleteException(Throwable e){
            super("删除数据失败", e);
        }
    }
    
    public static class DBReadException extends DBException{
		private static final long serialVersionUID = 1523335584531069105L;
		public DBReadException(Throwable e){
            super("读取数据错误", e);
        }
    }
    
    public static class ExclusiveVoid extends DBException{
		private static final long serialVersionUID = -3552186674517777911L;
		public ExclusiveVoid(){
            super("当前数据库已经被其他资源打开");
        }
    }
    
    public static class NotDataFile extends DBException{
		private static final long serialVersionUID = -3168054513383209931L;
		public NotDataFile(){
            super("无法找到数据文件");
        }
    }
    
    public static class NotOffsetFile extends DBException{
		private static final long serialVersionUID = 7850572737507444352L;
		public NotOffsetFile(){
            super("无法找到offset文件");
        }
    }
    
    public static class NotIndexFile extends DBException{
		private static final long serialVersionUID = -5700865508398535262L;
		public NotIndexFile(){
            super("无法找到index文件");
        }
    }
    
    public static class ReadOnlyException extends DBException{
		private static final long serialVersionUID = -6292766616745215611L;
		public ReadOnlyException(){
            super("read only");
        }
    }
}